Skip to content

Release 0.30.2: safer with crafted files, faster 3MF copies, Build plate in two columns - #87

Merged
sevagjb merged 4 commits into
mainfrom
file-safety-fixes
Nov 9, 2026
Merged

sevagjb merged 4 commits into
mainfrom
file-safety-fixes

Conversation

@sevagjb

@sevagjb sevagjb commented Nov 9, 2026 •

Copy link
Copy Markdown
Owner

Release 0.30.2. Merging publishes the release.

Fixed: files made to harm

Four ways a crafted file could misuse PrintView3D, found in a review of the code:

  • 3MF triangles: a triangle that uses a vertex that doesn't exist crashed the program (the 3D engine doesn't check this). Such a file is now refused with an error message.
  • glTF data outside its buffer: a crafted byteStride or count read whatever followed the buffer in memory, or crashed. Data must now lie inside its buffer, and glTF triangles must use existing vertices.
  • Text from a file read as HTML: title, description, object names, their tooltips, FreeCAD object names and the error messages are now plain text.
  • Loading that never ended: a glTF node listed as its own child, or 3MF objects that contain themselves or place each other without end. glTF nodes are visited once; 3MF objects that contain themselves are skipped and a file may place at most 200,000 objects. The macOS Quick Look reader gets the same limit.

Changed

  • 3MF projects with many copies of one object open faster: an object placed many times is read once instead of once per copy.
  • Settings → Viewer: the Build plate box in two columns (the plate on the left; the grid's numbers and lines on the right). In a window too narrow for both, the right column goes under the left one, and Settings opens wide enough for the two columns when the screen allows.

Translations

Arabic and Dutch: the changelog sections (CHANGELOG.ar.md, CHANGELOG.nl.md) are reviewed by @sevagjb. No texts in the program changed. Romanian shows this version in English until it is translated.

Still to do before merging

  • Portable build not tested yet.

Checked

Windows, Linux, macOS Apple silicon and macOS Intel build and pass their tests in CI, including the Quick Look (Swift) build. 824 tests pass, including new ones with crafted 3MF and glTF files (tests/test_file_safety.py) and for the two-column layout (tests/test_viewer_settings_layout.py).

The first CI run failed on macOS: on a screen too narrow for the two columns, Settings was not tall enough for the page. Fixed in the last commit; Settings is now fitted to its pages' real sizes when it opens.


Generated by Claude Code

…lead PrintView3D

- 3MF: a triangle that uses a vertex that does not exist is refused. The 3D engine
  does not check this itself, and such a file crashed the whole program.
- glTF: data must lie inside its buffer. A crafted byteStride or count read whatever
  followed the buffer in memory, or crashed. Triangles must use existing vertices too.
- Text from a file (title, description, object names, error texts) is shown as plain
  text in the Details and Objects boxes, their tooltips and the error messages. It
  was read as HTML, so a title like <img src=...> was carried out instead of shown.
- Loading that never ended: a glTF node listed as its own child, or 3MF objects that
  contain themselves or place each other without end. Nodes are visited once; 3MF
  objects that contain themselves are skipped and a file may place 200,000 objects
  at most. The macOS Quick Look reader gets the same limit.

A 3MF object placed many times is now read once instead of every time, which also
makes projects with many copies of one object open faster.
Left: the plate itself (grid on/off, X/Y/Z axes, which plate, its size). Right: the
grid's numbers and lines (numbers on/off, their spacing, the two line spacings). The
box is half as tall, with room for more options.

A window too narrow for both columns shows the right one under the left one instead
of cutting it off, and Settings opens wide enough for the two columns when the
screen allows it.
The Build plate box's two columns go under each other when the window is too narrow
for both, which makes the Viewer page taller. Settings still chose its height for the
two-column arrangement, so on a narrow screen the page got a scroll bar (the macOS
test run, whose test screen is 800 px wide, caught it).

The two-column box now reports its height for a given width, and when Settings opens
it is fitted once to the real sizes, after the theme's fonts and paddings are applied:
wide enough for the two columns and tall enough for the tallest page, as far as the
screen allows.
@sevagjb
sevagjb merged commit 051f048 into main Nov 9, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants